using IM.Easy.Core.ServiceLifetime;
using IM.Easy.Core.Services;
using IM.Easy.Core.Utils;
using IM.Easy.Infrastructure.Query;
using IM.Easy.Entity.System;
using IM.Easy.SystemServices.Dtos;

namespace IM.Easy.SystemServices.IServices
{
    public interface IUserRoleService
    {


        /// <summary>
        /// 根据 ID 获取实体
        /// </summary>
        /// <param name="id">实体的唯一标识</param>
        /// <returns>获取的实体</returns>
        SysUserRole GetById(long id);

        /// <summary>
        /// 获取所有实体
        /// </summary>
        /// <returns>所有实体的列表</returns>
        PageResponse<SysUserRole> GetPageList(UserRoleQueryDto query);

        /// <summary>
        /// 根据 ID 删除实体
        /// </summary>
        /// <param name="id">要删除的实体的唯一标识</param>
        /// <returns>操作是否成功</returns>
        bool Delete(params long[] key);

        /// <summary>
        /// 获取用户角色
        /// </summary>
        /// <param name="userId"></param>
        List<SysRole> GetUserRoles(long userId);

        /// <summary>
        /// 保存用户角色
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        bool SaveUserRoles(UserRoleDto dto);
    }
}
